package com.kfc.sales;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainMenu extends Activity{
	
	Button logout;
	Button bestseller;
	Button topseller;
	Button productlist;
	Button viewsales;
	
	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.mainmenu);
        
        logout = (Button) findViewById(R.id.logout);
        bestseller = (Button) findViewById(R.id.bestseller);
        topseller = (Button) findViewById(R.id.topseller);
        productlist = (Button) findViewById(R.id.productlist);
        viewsales = (Button) findViewById(R.id.viewsales);
        
        logout.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				logout(v);
			}
		});
        
        bestseller.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent i=new Intent(v.getContext(),BestSeller.class);
				startActivity(i);
				
			}
		});
        
        topseller.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent i=new Intent(v.getContext(),TopSeller.class);
				startActivity(i);
				
			}
		});
        
        productlist.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent i=new Intent(v.getContext(),ProductCategories.class);
				startActivity(i);
				
			}
		});
        
        viewsales.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				// TODO Auto-generated method stub
				Intent i=new Intent(v.getContext(),SearchLocation.class);
				startActivity(i);
				
			}
		});
        
	}
	
	public void logout(View v){
		Intent i=new Intent(v.getContext(), KFCSalesActivity.class);
		startActivity(i);
	}

}
